<?php

namespace Common\Logic;

/**
 * Description of HotelAuthorityLogic.class控制器实例
 * 
 * @author songanwei
 * @date 2016-1-6
 */
class HotelAuthorityLogic extends \Common\Controller\BaseController {

    public function getAuthority() {
        return $this->__singleGet('_getAuthority', array());
    }

    /**
     * 返回权限数据
     * @return type
     */
    protected function _getAuthority() {
        $authorityLabelModel = D('AuthorityLabel');
        $authorityLabels = $authorityLabelModel->getAll();
        $hotelAuthorityModel = D('HotelAuthority');
        foreach ($authorityLabels as &$authorityLabel) {
            $authorityLabel['authoritys'] = $hotelAuthorityModel->getAllByLabel($authorityLabel['id']);
        }
        return $authorityLabels;
    }

}
